package top.scsoul.voes.common.core.domain.model;

import cn.afterturn.easypoi.excel.annotation.Excel;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;
import java.util.List;

public class UserVo {
    /**
     * 登录名
     */
    @Excel(name = "登录名")
    @Length(min = 1, max = 100, message = "登录名应该在1-100个字符之间")
    private String username;
    /**
     * 密码
     */
    @Excel(name = "密码")
    @Length(min = 6, max = 100, message = "密码应该在6-100个字符之间")
    private String password;
    /**
     * 真实姓名
     */
    @Excel(name = "真实姓名")
    @Length(min = 1, max = 20, message = "真实姓名应该在1-20个字符之间")
    private String name;
    /**
     * 性别
     */

    @Range(min = 1, max = 2)
    @Excel(name = "性别", replace = {"男_1", "女_2"})
    private Integer gender;
    /**
     * 身份证号码
     */
    @Length(max = 18, min = 15, message = "身份证号长度只能是15-18位")
    private String idCard;
    /**
     * 电话号码
     */
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码有误")
    @Excel(name = "手机号码")
    private String phone;
    /**
     * 状态
     */
    @Excel(name = "状态", replace = {"正常_1", "停用_2"})
    private Integer state;
    /**
     * 角色ID
     */
    private List<Integer> roleIds;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public List<Integer> getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(List<Integer> roleIds) {
        this.roleIds = roleIds;
    }

    @Override
    public String toString() {
        return "AddUser{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", gender=" + gender +
                ", idCard='" + idCard + '\'' +
                ", phone='" + phone + '\'' +
                ", state=" + state +
                ", roleIds=" + roleIds +
                '}';
    }
}


